#ifndef COMPUTESHADER_H
#define COMPUTESHADER_H

#include <string>
#include <d3d11.h>

class ComputeShader
{
public:
	ComputeShader();
	~ComputeShader();
	bool Load(const std::string& filename);
	void Run();

	ID3D11ShaderResourceView* GetResult();

private:
	HRESULT CompileShader(_In_ const std::string& filename, _In_ const std::string& functionName,
                              _In_ ID3D11Device* device, _Outptr_ ID3DBlob** blob);

private:
	int m_screenX;
	int m_screenY;

	ID3D11ComputeShader* m_computeShader;
	ID3D11Buffer* m_inputDataBuffer;
	ID3D11ShaderResourceView* m_objectsSRV;

	ID3D11Texture2D* m_texture;
	ID3D11ShaderResourceView* m_srvTexture;
	ID3D11UnorderedAccessView* m_uavTexture;
	ID3D11Buffer* m_textureBuffer;

	ID3D11Buffer* m_debugBuffer;
	ID3D11UnorderedAccessView* m_debugUAV;
};

#endif //COMPUTESHADER_H